package com.gt.quality.system.service.modelservice;

import com.gt.quality.apim.domain.ApiRelationshipInterfaceInfo;
import com.gt.quality.apim.service.impl.ApiDataInfoServiceImpl;
import org.springframework.stereotype.Component;

/**
 * Mybatis-Plus:Model模型代理器
 * @author makeJava
 */
@Component
public class MybatisPlusModelServiceProxy {

    /**
     * Mybatis-plus Model模式注入操作对象
     */
    private volatile ApiRelationshipInterfaceInfo apiRelationshipInterfaceInfo;

    public ApiRelationshipInterfaceInfo getApiRelationshipInterfaceInfo() {
        if (apiRelationshipInterfaceInfo == null) {
            // 同步块
            synchronized (ApiDataInfoServiceImpl.class) {
                if (apiRelationshipInterfaceInfo == null) {
                    apiRelationshipInterfaceInfo = new ApiRelationshipInterfaceInfo();
                }
            }
        }
        return apiRelationshipInterfaceInfo;
    }
}
